import uitest
import uicls
import uiutil
import uiconst
import trinity
import blue

class NewFill(uicls.NewSprite):
    __guid__ = 'uicls.NewFill'
    default_name = 'fill'
    default_color = (1.0, 1.0, 1.0, 0.25)
    default_align = uiconst.TOALL
    default_state = uiconst.UI_DISABLED
    default_left = 0
    default_top = 0
    default_width = 0
    default_height = 0
    default_textureResPath = 'res:/uicore/texture/fill.dds'

    def ApplyAttributes(self, attributes):
        uicls.NewSprite.ApplyAttributes(self, attributes)
        color = attributes.get('color', self.default_color)
        if (color is not None):
            self.SetRGB(*color)
        self.texturePrimary = trinity.Tr2Sprite2dTexture()
        self.texturePrimary.resPath = 'res:/uicore/texture/uitest/uitestfill.dds'
        self.texturePrimary.filter = False
        self.blendMode = trinity.TR2_SBM_BLEND




